package com.mmd.common.enums;

public enum YesNoEnums {
    YES(1, "是"),
    NO(0, "否");

    private YesNoEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static YesNoEnums getStatusEnum(Integer code) {
        YesNoEnums[] enumArr = YesNoEnums.values();
        for (YesNoEnums e : enumArr) {
            if (code.equals(e.getCode())) {
                return e;
            }
        }
        return null;
    }

    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
